#!/usr/bin/env bash
# 在 bin/compile 命令最后注入

declare build

# post-compile 钩子调用保证能够找到编译后文件
env PATH="${build}/bin:${PATH}" ${buildpack}/hooks/run_hook "post-compile" "${build}" "bin/post-compile"

# 清理代码文件以减少 slug 包体积
if [ "${WITH_CODE_FILES}" != "1" ]; then
    rm -rf vendor || true
    find . -type f \( -name '*.go' -o -name '*.s' -o -name '*.c' -o -name '*.cpp' \) -delete || true
fi